home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / admin / xinetd.2 / xinetd / xinetd.2.1.7-linux.4 / libs / src / str / Makefile < prev    next >
Encoding:
Makefile  |  1993-07-25  |  4.4 KB  |  164 lines

  1. # (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  2. # All rights reserved.  The file named COPYRIGHT specifies the terms 
  3. # and conditions for redistribution.
  4.  
  5. #
  6. # $Id: Makefile,v 3.2 1993/06/16 00:06:57 panos Exp $
  7. #
  8. # Based on Library makefile template: *Revision: 1.15 *
  9. #
  10.  
  11. # Available entries:
  12. #         lib             --> creates the library
  13. #        install        --> installs the library (archive, man page(s), header(s))
  14. #        uninstall    --> uninstall the library
  15. #        clean            --> removes all .o and .a files
  16. #        spotless        --> clean + uninstall
  17. #         lint            --> lints a file (usage: make lint MODULE=foo.c)
  18. #        tags            --> creates a tags file (from the SOURCES and HEADERS)
  19. #        checkout     --> checkout all files
  20. #        dist            --> distribution support
  21. #
  22.  
  23. NAME                = str
  24. VERSION            = 1.4.1
  25.  
  26. HEADERS            = str.h strparse.h \
  27.                         ss_impl.h ss_rk.h ss_kmp.h ss_sbm.h ss_bmh.h ss_so.h
  28. SOURCES            = strutil.c strprint.c strparse.c strs.c \
  29.                         ss_rk.c ss_kmp.c ss_bf.c ss_sbm.c ss_bmh.c ss_so.c
  30. OBJECTS            = strutil.o strprint.o strparse.o strs.o \
  31.                         ss_rk.o ss_kmp.o ss_bf.o ss_sbm.o ss_bmh.o ss_so.o
  32.  
  33. MANFILES            = strparse.3 strprint.3 strutil.3 strs.3
  34. INCLUDEFILES    = str.h
  35.  
  36. # The following variables are used by the 'install' entry and
  37. # should be customized:
  38. #     LIBDIR:     where the library will be placed
  39. #     INCUDEDIR:  where the include files will be placed
  40. #     MANDIR:     where the man pages will be placed
  41. #
  42. LIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  43. MANDIR            = $(HOME)/.links/manpages/man3
  44. INCLUDEDIR        = $(HOME)/.links/includes
  45.  
  46. #
  47. # Available flags
  48. #    NBIC                : number of bits in a character variable (defaults to 8)
  49. #    WIDE_INT            : widest integer supported by the CPU/compiler
  50. #                          (defaults to 'long')
  51. #    WIDE_INT_SIZE  : size of the WIDE_INT type in bits (defaults to 32);
  52. #                          effective (and required) only when WIDE_INT is defined
  53. #    NO_SIO            : if the SIO library is not available (results in turning
  54. #                          all the string printing functions to no-ops)
  55. #
  56. DEFS                =         # for example, -DNO_SIO
  57. DEBUG                = -g                # -g or -O
  58. VERSION_DEF        = -DVERSION=\"STR\ Version\ $(VERSION)\"
  59.  
  60. CPP_DEFS            = $(VERSION_DEF) $(DEFS)
  61.  
  62. #
  63. # The following variables shouldn't need to be changed
  64. #
  65. LINT_FLAGS        = -hbux
  66. CPP_FLAGS        = $(CPP_DEFS) -I$(INCLUDEDIR)
  67. CC_FLAGS            = $(DEBUG)
  68. CFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  69.  
  70. INSTALL            = install -c
  71. FMODE                = -m 640            # used by install
  72. RANLIB            = ranlib
  73.  
  74. PAGER                = less
  75.  
  76.  
  77. LIBNAME            = lib$(NAME).a
  78.  
  79. lib: $(LIBNAME)
  80.  
  81. libopt: clean
  82.     make DEBUG=-O "DEFS=$(DEFS)" lib
  83.     $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)-O
  84.  
  85. $(LIBNAME): $(OBJECTS)
  86.     ar r $@ $?
  87.     $(RANLIB) $@
  88.  
  89. LINT_IGNORE=possible pointer alignment|RCSid unused
  90.  
  91. lint:
  92.     lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | egrep -v '$(LINT_IGNORE)' | $(PAGER)
  93.  
  94. install: $(LIBNAME)
  95.     @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  96.     then \
  97.         $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  98.         echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  99.         for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  100.         echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  101.         for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  102.         echo Installed $(MANFILES) to $(MANDIR) ;\
  103.     else \
  104.         echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  105.     fi
  106.  
  107. uninstall:
  108.     a=`pwd` ; cd $(INCLUDEDIR) ;\
  109.     if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  110.     a=`pwd` ; cd $(LIBDIR) ;\
  111.     if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  112.     a=`pwd` ; cd $(MANDIR) ;\
  113.     if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  114.  
  115. clean:
  116.     rm -f $(OBJECTS) $(LIBNAME) core
  117.  
  118. spotless: clean uninstall
  119.  
  120. tags: $(SOURCES) $(HEADERS)
  121.     ctags -w $(SOURCES) $(HEADERS)
  122.  
  123. checkout:
  124.     co $(SOURCES) $(HEADERS) $(MANFILES)
  125.  
  126. #
  127. # Distribution section
  128. # This section contains the 2 targets for distribution support: dist, dirs
  129. # "dist" checks out all files to be distributed
  130. # "dirs" prints a list of directories to be included in the distribution.
  131. # These directories should have a Makefile with a "dist" target
  132. #
  133. DISTRIBUTION_FILES    = $(SOURCES) $(HEADERS) $(MANFILES) COPYRIGHT README
  134. DIRS                        =
  135.  
  136. dist:
  137.     -co -q $(DISTRIBUTION_FILES)
  138.  
  139. dirs:
  140.     @echo $(DIRS)
  141.  
  142. #
  143. # PUT HERE THE RULES TO MAKE THE OBJECT FILES
  144. #
  145. strparse.o:        strparse.h str.h
  146. strprint.o:        str.h
  147. strutil.o:        str.h
  148. strs.o:            ss_impl.h str.h
  149. ss_bf.o:            ss_impl.h
  150. ss_rk.o:            ss_impl.h ss_rk.h
  151. ss_kmp.o:        ss_impl.h ss_kmp.h
  152. ss_sbm.o:        ss_impl.h ss_sbm.h
  153. ss_bmh.o:        ss_impl.h ss_bmh.h
  154. ss_so.o:            ss_impl.h ss_so.h
  155.  
  156.  
  157. #
  158. # Test program
  159. #
  160. tt: tt.c $(LIBNAME)
  161.     $(CC) -I$(INCDIR) -g -o $@ tt.c $(LIBNAME) -L$(LIBDIR) -lsio -lmisc
  162.  
  163.